package server.command.ecs;

import app_kvServer.KVServer;
import server.command.client.ClientInputHandler;
import server.command.client.ICommand;
import utils.IKeyValueStorage;
import common.messages.KVMessage.StatusType;

public class CommandStopServer implements ICommand {
	private KVServer server;
	
	public CommandStopServer(KVServer server) {
		this.server = server;
	}
	
	@Override
	public String execute() {
		server.setServerState(KVServer.ServerState.CLOSED);
		return ClientInputHandler.composeClientResponse(StatusType.SERVER_STOPPED, " ", ""); 
	}
}
